<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>军昂管理系统</title>
    <link th:include="common/head :: copy">

    <script src="/easyui/themes/super/superDemo.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
        $(function () {
            var content="<iframe frameborder=0 scrolling='auto' style='width:100%;height:99%' src='/sys/perm/page'></iframe>";
            $("#tt").tabs("add",{
                title:"首页",
                iconCls:"fa fa-home",
                closable:false,
                content:content
            });
        })
        /*	function resetValue() {
                $("#fm").form("clear");
            }
            function openModifyPassword() {
                $("#dlg").dialog("open");
            }
            function closemodifyPassword() {
                $("#dlg").dialog("close");
            }
            function modifyPassword(){
                $("#fm").form("submit",{
                    url:'url',
                    onSubmit:function(){
                        var newPassword=$("#newPassword").val();
                        var okPassword=$("#okPassword").val();
                        if(newPassword!=okPassword){
                            message("确认新密码输入错误！")
                            return false;
                        }
                        return true;
                    },
                    success:function(result){
                        var result=eval('('+result+')');
                        if(result.success){
                            message("密码修改成功，下一次登录生效！");
                            $("#dlg").dialog("close");
                        }else{
                            message("密码修改失败，请联系管理员！");
                        }
                    }
                });
            }*/
    </script>
    <!--<script type="text/javascript">
    $(document).ready(function() {
        var content="<iframe frameborder=0 scrolling='auto' style='width:100%;height:99%' src='/first'></iframe>";
        $("#tabs").tabs("add",{
            title:"首页",
            iconCls:"menu-25",
            closable:false,
            content:content
        });

        $("#tree").tree({
            lines:true,
            url:'/sys/perm',
            method:'get',
            onLoadSuccess:function(){
                $("#tree").tree("expandAll");
            },
            onClick:function(node){
                if(node.id==6040){
                    openPasswordModifyDialog();
                }else if(node.id==6050){
                    logout();
                }else if(node.attributes.url){
                    openTab(node);
                }
            }
        });
        // 监听右键事件，创建右键菜单
        $('#tabs').tabs({
            onContextMenu:function(e, title,index){
                e.preventDefault();
                if(index>0){
                    $('#menu').menu('show', {
                        left: e.pageX,
                        top: e.pageY
                    }).data("tabTitle", title);
                }
            }
        });
         // 右键菜单click
        $("#menu").menu({
            onClick : function (item) {
                closeTab(this, item.name);
            }
        });

        function closeTab(menu, type) {
            var allTabs = $("#tabs").tabs('tabs');
            var allTabtitle = [];
            $.each(allTabs, function (i, n) {
                var opt = $(n).panel('options');
                if (opt.closable)
                    allTabtitle.push(opt.title);
            });
            var curTabTitle = $(menu).data("tabTitle");
            var curTabIndex = $("#tabs").tabs("getTabIndex", $("#tabs").tabs("getTab", curTabTitle));
            switch (type) {
                   case "1": // 刷新当前标签页
                    var panel = $("#tabs").tabs("getTab", curTabTitle).panel("refresh");
                    break;
                case "2": // 关闭当前标签页
                    $("#tabs").tabs("close", curTabIndex);
                    return false;
                    break;
                case "3": // 关闭全部标签页
                    for (var i = 0; i < allTabtitle.length; i++) {
                        $('#tabs').tabs('close', allTabtitle[i]);
                    }
                    break;
                case "4": // 关闭其他标签页
                    for (var i = 0; i < allTabtitle.length; i++) {
                        if (curTabTitle != allTabtitle[i])
                            $('#tabs').tabs('close', allTabtitle[i]);
                    }
                    $('#tabs').tabs('select', curTabTitle);
                    break;
                case "5": // 关闭右侧标签页
                    for (var i = curTabIndex; i < allTabtitle.length; i++) {
                        $('#tabs').tabs('close', allTabtitle[i]);
                    }
                    $('#tabs').tabs('select', curTabTitle);
                    break;
                case "6": // 关闭左侧标签页
                    for (var i = 0; i < curTabIndex - 1; i++) {
                        $('#tabs').tabs('close', allTabtitle[i]);
                    }
                    $('#tabs').tabs('select', curTabTitle);
                    break;

            }

        }

        function openTab(node){
            if($("#tabs").tabs("exists",node.text)){
                $("#tabs").tabs("select",node.text)
            }else{
                var content="<iframe frameborder=0 scrolling='auto' style='width:100%;height:99%' src='"+node.attributes.url+"'></iframe>";

                $("#tabs").tabs("add",{
                    title:node.text,
                    iconCls:node.iconCls,
                    closable:true,
                    content:content
                });
            }
        }
    });
    function openPasswordModifyDialog(){
        $("#dlg").dialog("open").dialog("setTitle","修改密码");
        url="/admin/user/modifyPassword";
    }
    function logout(){
        $.messager.confirm("系统提示","您确定要退出系统吗?",function(r){
            if(r){
                window.location.href="/admin/user/logout";
            }
        });
    }
    function closePasswordModifyDialog(){
        resetValue();
        $("#dlg").dialog("close");
    }
    function modifyPassword(){
        $("#fm").form("submit",{
            url:url,
            onSubmit:function(){
                var newPassword=$("#newPassword").val();
                var newPassword2=$("#newPassword2").val();
                if(!$(this).form("validate")){
                    return false;
                }
                if(newPassword!=newPassword2){
                    $.messager.alert("系统提示","确认新密码输入错误！");
                    return false;
                }
                return true;
            },
            success:function(result){
                var result=eval('('+result+')');
                if(result.success){
                    $.messager.alert("系统提示","密码修改成功，下一次登录生效！");
                    resetValue();
                    $("#dlg").dialog("close");
                }else{
                    $.messager.alert("系统提示","密码修改失败，请联系管理员！");
                }
            }
        });
    }
    function resetValue(){
        $("#newPassword").val("");
        $("#newPassword2").val("");
    }
</script>-->
</head>
<!--<body class="easyui-layout">
<div region="north" style="height: 72px;">
	<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td width="285px" style="background:url(/images/top_left.jpg)">
			</td>
			<td style="background:url(/images/top_center.jpg)">
				<div id="userInfo" class="userInfo"></div>
			</td>
			<td valign="bottom" width="544px" style="background:url(/images/top_right.jpg)">
				<div id="clock" class="clock"></div>
			</td>
		</tr>
	</table>
</div>

<div region="center">
	<div id="tabs" class="easyui-tabs" fit="true" border="false"></div>
</div>

<div region="west" style="width: 200px" title="导航菜单" split="true" iconCls="icon-navigation">
	<ul id="tree" class="easyui-tree" style="padding: 10px"></ul>
</div>

<div region="south" style="height: 30px;padding: 5px" align="center">
	Copyright © 2020-2020 军昂科技  版权所有
</div>

<div id="dlg" class="easyui-dialog" style="width: 400px;height: 180px;padding: 10px 20px"
	closed="true" buttons="#dlg-buttons" data-options="onClose:function(){resetValue()}">
		<form id="fm" method="post">
			<table cellspacing="8px">
				<tr>
					<td>新密码：</td>
					<td>
						<input type="password" id="newPassword" name="newPassword" class="easyui-validatebox" required="true" style="width: 200px"/>
					</td>
				</tr>
				<tr>
					<td>确认新密码：</td>
					<td>
						<input type="password" id="newPassword2" name="newPassword2" class="easyui-validatebox" required="true" style="width: 200px"/>
					</td>
				</tr>
			</table>
		</form>
	</div>

	<div id="dlg-buttons">
		<a href="javascript:modifyPassword()" class="easyui-linkbutton" iconCls="icon-ok" >保存</a>
		<a href="javascript:closePasswordModifyDialog()" class="easyui-linkbutton" iconCls="icon-cancel" >关闭</a>
	</div>


<div id="menu" class="easyui-menu" >
     <div id="mm-tabrefresh" data-options="name:1,iconCls:'icon-refresh'"> 刷新当前标签页</div>
     <div class="menu-sep"></div>
     <div id="mm-tabclose" data-options="name:2,iconCls:'icon-closetab'">关闭当前标签页</div>
     <div id="mm-tabcloseall" data-options="name:3,iconCls:'icon-closealltab'">关闭全部标签页</div>
     <div id="mm-tabcloseother" data-options="name:4,iconCls:'icon-closeothertab'">关闭其他标签页</div>
     <div id="mm-tabcloseright" data-options="name:5,iconCls:'icon-closerighttab'">关闭右侧标签页</div>
     <div id="mm-tabcloseleft" data-options="name:6,iconCls:'icon-closelefttab'">关闭左侧标签页</div>
 </div>
</body>-->
<script type="text/javascript">
    function resetValue() {
        $("#fm").from("clear");
    }
    function openModifyPassword() {
        $("#dlg").dialog("open");
    }
    function closePasswordModifyDialog() {
        $("#dlg").dialog("close");
    }
    function modifyPassword(){
        $("#fm").form("submit",{
            url:"/modifyPassword",
            onSubmit:function(){
                var newPassword=$("#newPassword").val();
                var okPassword=$("#okPassword").val();
                if(newPassword!=okPassword){
                    message("确认新密码输入错误！")
                    return false;
                }
                return true;
            },
            success:function(result){
                var result=eval('('+result+')');
                if(result.success){
                    message("密码修改成功，下一次登录生效！")
                    $("#dlg").dialog("close");
                }else{
                    message("密码修改失败，请联系管理员！")
                }
            }
        });
    }
</script>
<body id="main" class="easyui-layout super-theme-example" >
<div id="dlg" title="修改密码" class="easyui-dialog" style="width: 350px;height: 250px;padding: 10px 20px"
     closed="true" buttons="#dlg-buttons" data-options="onClose:function(){resetValue()}">
    <form id="fm" method="post">
        <table cellspacing="8px">
            <tr>
                <td>旧密码：</td>
                <td>
                    <input class="easyui-passwordbox" id="oldPassword" name="oldPassword" prompt="旧密码" iconWidth="28" style="width: 200px">
                </td>
            </tr>
            <tr>
                <td>新密码：</td>
                <td>
                    <input class="easyui-passwordbox" prompt="新密码" id="newPassword" name="newPassword" iconWidth="28" style="width: 200px">
                </td>
            </tr>
            <tr>
                <td>确认密码：</td>
                <td>
                    <input class="easyui-passwordbox" prompt="确认密码" id="okPassword" name="okPassword" iconWidth="28" style="width: 200px">
                </td>
            </tr>
        </table>
    </form>
</div>

<div id="dlg-buttons">
    <a href="javascript:modifyPassword()" class="easyui-linkbutton primary" >保存</a>
    <a href="javascript:closePasswordModifyDialog()" class="easyui-linkbutton"  >关闭</a>
</div>
<div data-options="region:'north',border:false" class="super-north">
    <!--顶部-->
    <div class="super-navigation">
        <!--系统名称-->
        <div class="super-navigation-title">第五军医大分诊管理</div>
        <!--自定义导航-->
        <div class="super-navigation-main">
            <div class="super-setting-left">
                <ul>
                    <li><i class="fa fa-commenting-o"></i>消息</li>
                    <li><i class="fa fa-envelope-o"></i>邮件</li>
                    <li><i class="fa fa-bell-o"></i>通知</li>
                </ul>
            </div>
            <div class="super-setting-right">
                <ul>
                    <li>
                        <div class="super-setting-icon">
                            <i class="fa fa-gears"></i>
                        </div>
                        <div id="mm" class="easyui-menu">
                            <div onclick="openModifyPassword()">修改密码</div>
                            <div id="themeSetting">主题</div>
                            <div class="menu-sep"></div>
                            <div id="logout">退出</div>
                        </div>
                    </li>
                    <li class="user">
                        <span class="user-icon"><img src="/images/favicon.png"/></span>管理员
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
<div data-options="region:'west',title:'菜单',border:false" class="super-west">
    <!--左侧导航-->
    <div class="easyui-accordion" data-options="border:false" id="main-menu">

    </div>
</div>
<div data-options="region:'center'" style="padding-top: 2px;">
    <!--主要内容-->
    <div id="tt" class="easyui-tabs" data-options="border:false,fit:true">

    </div>
</div>
<div data-options="region:'east',title:'East',split:true" style="width:100px;">

</div>
<div data-options="region:'south'" class="super-south">
    <!--页脚-->
    <div class="super-footer-info">
        <span><i class="fa fa-info-circle"></i> 作者：tianyu</span>
        <span><i class="fa fa-copyright"></i> CopyRight 2017 版权所有 <i class="fa fa-caret-right"></i></span>
    </div>
</div>

<!--主题设置弹窗-->
<div id="win">
    <div class="themeItem">
        <ul>
            <li>
                <div class="superGreen" style="background: #1abc9c;">green</div>
            </li>
            <li class="themeActive">
                <div class="superBlue" style="background: #3498db;">blue</div>
            </li>
            <li>
                <div class="superGray" style="background: #95a5a6;">gray</div>
            </li>
            <li>
                <div class="superAmethyst" style="background: #9b59b6;">amethyst</div>
            </li>
            <li>
                <div class="superBlack" style="background: #34495e;">black</div>
            </li>
            <li>
                <div class="superYellow" style="background: #e67e22;">yellow</div>
            </li>
            <li>
                <div class="superEmerald" style="background: #2ecc71;">emerald</div>
            </li>
            <li>
                <div class="superRed" style="background: #e74c3c;">red</div>
            </li>
        </ul>
    </div>
</div>
<!--
<div id="dlg" title="修改密码" class="easyui-dialog super-theme-example" style="width: 350px;height: 250px;padding: 10px 20px"
	 closed="true" buttons="#dlg-buttons" data-options="onClose:function(){resetValue()}">
	<form id="fm" method="post">

		<table cellspacing="8px" class="form-item">
			<tr>
				<td>旧密码：</td>
				<td>
					<input class="easyui-passwordbox"  id="oldPassword" name="oldPassword"   iconWidth="28" style="width: 200px">
				</td>
			</tr>
			<tr>
				<td>新密码：</td>
				<td>
					<input class="easyui-passwordbox" id="newPassword" name="newPassword"  iconWidth="28" style="width: 200px">
				</td>
			</tr>
			<tr>
				<td>确认密码：</td>
				<td>
					<input class="easyui-passwordbox" id="okPassword" name="okPassword"  iconWidth="28" style="width: 200px">
				</td>
			</tr>
		</table>
	</form>
</div>

<div id="dlg-buttons">
	<a href="javascript:modifyPassword()" class="easyui-linkbutton primary"  >保存</a>
	<a href="javascript:closemodifyPassword()" class="easyui-linkbutton"  >关闭</a>
</div>
-->

</body>
</html>

